import s from './index.less'
import React from 'react'
import { Breadcrumb } from 'antd'
import { connect } from 'dva'

const Comp = (props) => {
  const { breadcrumb } = props
  // console.log(breadcrumb)
  let len = breadcrumb.length
  let last = breadcrumb[len - 1]
  return (
    <div className={s.bread}>
      <Breadcrumb>
        <Breadcrumb.Item href={'/home'}>首页</Breadcrumb.Item>
        {breadcrumb && breadcrumb.map(item => {
          return item.name ? <Breadcrumb.Item key={item.path}>{item.name}</Breadcrumb.Item> : null
        })}
      </Breadcrumb>
      <div className={s.title}>{last ? last.name : ''}</div>
    </div>
  )
}

export default connect((s) => ({ ...s.menuList }))(Comp)

